import request from '@/utils/request'

export function getPageList(query) {
  return request({
    url: '/api/auth/pageList',
    method: 'get',
    params: query
  })
}

export function create(data) {
  return request({
    url: '/api/auth/create',
    method: 'post',
    data
  })
}

export function update(data, id) {
  return request({
    url: `/api/auth/update/${id}`,
    method: 'post',
    data
  })
}

export function deleteInfo(id) {
  return request({
    url: `/api/auth/delete/${id}`,
    method: 'post'
  })
}

export function updateStatus(id) {
  return request({
    url: `/api/auth/updateStatus/${id}`,
    method: 'post'
  })
}

export function resetPwd(data, id) {
  return request({
    url: `/api/auth/resetPwd/${id}`,
    method: 'post',
    data
  })
}

// 用户头像上传
export function uploadAvatar(data) {
  return request({
    url: '/system/user/profile/img',
    method: 'post',
    data: data
  })
}
